<form method="post" enctype="multipart/form-data" id="import_form"
    action="index.php?app=wms&ctl=admin_logistImport&act=doImport"
    class="tableform"><input type="hidden" name="app" value="ome" />
<input type="hidden" name="model" value="order" />
<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td style="text-align: right; padding-top: 3px; padding-right: 10px;"><{help
        docid="76" type="link"}><{t}>点击查看帮助<{/t}><{/help}></td>
    </tr>
</table>

<div id="information" class="division" style="display:none;">
    <div style="color:#ff0000;"><b>错误信息如下：</b></div>
    <div id="errorInfo" style="width:450px;height:150px;padding:5px;overflow-y:auto;line-height:150%;border:1px solid #999;"></div>
</div>

<h4><{t}>请填写快递揽件导入导入参数<{/t}></h4>
<div class="division">
<table cellpadding="0" cellspacing="0" border="0">
    <tr>
        <th>标题：</th>
        <td><{input type="text" name="groupon_name" vtype="required" }><em class="red">*</em></td>
    </tr>
    <tr>
        <th><{t}>导出模板：<{/t}></th>
        <td><a target="_blank" href="index.php?app=wms&ctl=admin_logistImport&act=exportOrderTemplate" label="导出模板">
            <span>导出模板          </span>
        </a></td>
</table>
</div>
</table>
<div class="division">
<table cellpadding="0" cellspacing="0" border="0">
    <tr>
        <th><{t}>上传文件：<{/t}></th>
        <td><input type="file" name="import_file" /></td>
    </tr>
    <tr>
        <th>&nbsp;</th>
        <td><{button class="btn-primary" id='btn-submit' label="上传" type="button"}></td>
    </tr>
</table>
</div>
</form>

<script>
(function(){
    $('import_form').store('target',{
        onComplete:function(jsontext){
            var json = JSON.decode(jsontext);
            if (json.result == 'succ'){
                $('btn-submit').set('html', '<span><span>上传</span></span>');
                $('btn-submit').set('disabled', '');
                MessageBox.success('揽件信息导入成功！');
            }else{
                MessageBox.error('揽件信息导入失败！');
                $('information').style.display ='';
                var errorInfo = '';
                for(var key=0; key<json['msg'].length;key++){
                    errorInfo = errorInfo + json['msg'][key] + '<br />';
                }
                $('errorInfo').set('html', errorInfo);
                $('btn-submit').set('html', '<span><span>上传</span></span>');
                $('btn-submit').set('disabled', '');
            }
        }
    });

    $('btn-submit').addEvent('click',function(){
        $('information').style.display ='none';
        $('errorInfo').set('html', '');
        $('import_form').fireEvent('submit',{stop:$empty});
    });
})();
</script>